import { IUser } from "@/store/user";
import { customRequest } from "../utils/request";

export interface getMEssageDto {
  roomId: number;
}

export type MessageType = "Text" | "Image" | "Audio" | "Video";

export interface IMessage {
  id: number;
  senderId: number;
  sender: IUser;
  roomId: number;
  type: MessageType;
  content: string;
  createTime: string;
  updateTime: string;
}
export const getMessageList = (data: getMEssageDto) => {
  return customRequest<IMessage[]>({
    url: "/message/list",
    method: "get",
    params: data,
  });
};
